import { createConnection } from 'typeorm';
export const dbProviders = [
  {
    provide: 'DATABASE_CONNECTION',
    useFactory: async () => await createConnection(
      {
        type: 'mysql',
        host: 'localhost',
        port: 3306,
        username: 'root',
        password: '123456',
        database: 'world',
        entities: [
          __dirname + '/../../model/**/*.entity{.ts,.js}',
        ],
        synchronize: true,
        // migrations: [
        //   __dirname + '../../migration/**/*.ts'
        // ],
        // subscribers: [
        //   __dirname + '../../subscriber/**/*.ts'
        // ],
        // cli: {
        //   entitiesDir: 'src/entity',
        //   migrationsDir: 'src/migration',
        //   subscribersDir: 'src/subscriber'
        // }
    }
    ),
  },
];
